﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NHibernate.Mapping.Attributes;
using System.Runtime.Serialization;

namespace VemTransporte.Models.Basica
{
    [KnownType(typeof(LinhaParada))]
    [Class(Table = "LinhaParada")]
    public class LinhaParada
    {
        #region Atributos
        private int id;
        private Linha _Linha;
        private Parada _Parada;
        #endregion

        #region propriedades
        [Id(Name = "Id", Column = "PK_IdLinhaParada")]
        [Generator(1, Class = "native")]
        public virtual int Id
        {
            get { return id; }
            set { id = value; }
        }

        [ManyToOne(Name = "Linha", Column = "FK_IdLinha", ClassType = typeof(Linha))]
        public virtual Linha Linha
        {
            get { return _Linha; }
            set { _Linha = value; }
        }

        [ManyToOne(Name = "Parada", Column = "FK_IdParada", ClassType = typeof(Parada), Fetch = FetchMode.Join)]
        public virtual Parada Parada
        {
            get { return _Parada; }
            set { _Parada = value; }
        }
        #endregion

        #region Construtores
        public LinhaParada() { }
        #endregion

    }
}